package com.ubb.dbms.core.fileManagers.dataFileManager;

import java.io.File;
import java.util.Map;

import com.ubb.dbms.core.fileManagers.indexFileManager.IndexFileManager;
import com.ubb.dbms.domain.queryData.TableRowElements;
import com.ubb.dbms.domain.queryResult.SelectedRow;
import com.ubb.dbms.domain.xml.IndexFile;
import com.ubb.dbms.domain.xml.Table;

public interface DataFileManager {
	static final String DATABASES_FOLDER_NAME = "Databases" + File.separator;
	static final String DATA_FILES_EXTENSION = ".dat";
	static final String ROWS_STATES_DATA_FILES_EXTENSION = ".rsdat";

	void createFolderForDatabase(String databaseName);

	void createFileForTable(Table tablesssss, String usesDatabase);

	int insertRow(TableRowElements rowElements, Table table, String usesDatabase);

	void indexExistingTableData(IndexFile indexFile, Table table, String usesDatabase, IndexFileManager indexFileManager);
	
	SelectedRow readRow(Table table, String usesDatabase, int rowNr);
	
	SelectedRow readRow(Table table, String usesDatabase, int rowNr, Map<String, String> projections);
}
